// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   LockedCanvas.java

package canvas;

import java.io.IOException;
import javax.microedition.lcdui.*;

// Referenced classes of package mquran:
//            Quran

public class LockedCanvas extends Canvas
{

    public LockedCanvas(Quran m)
    {
        ix = 0;
        cxt = 0;
        midlet = m;
        try
        {
            setFullScreenMode(true);
            bg = Image.createImage("/images/bg.png");
        }
        catch(IOException ex)
        {
            ex.printStackTrace();
        }
    }

    public void paint(Graphics g)
    {
        int p = fontsmall.getHeight();
        g.setColor(0xffffff);
        g.fillRect(0, 0, getWidth(), getHeight());
        g.drawImage(bg, getWidth() / 2, 0, 17);
        g.setColor(0);
        g.setFont(fontBold);
        g.drawString("Info", 5, 35, 20);
        g.setFont(fontsmall);
        for(ix = cxt; ix < cxt + 6; ix++)
        {
            g.drawString(about[ix], 5, 38 + p, 20);
            p += fontsmall.getHeight();
        }

        g.setColor(0xb14c93);
        g.fillRect(0, getHeight() - 16, getWidth(), 1);
        g.setColor(0xa54889);
        g.fillRect(0, getHeight() - 15, getWidth(), 20);
        g.setColor(0xffffff);
        g.setFont(fontsmall);
        g.drawString("Keluar", getWidth() - 5, getHeight() - 1, 40);
    }

    protected void keyPressed(int keyCode)
    {
        if(keyCode == -7)
            midlet.exitMIDlet();
        if(keyCode == Quran.KEYDOWN)
        {
            if(cxt < about.length - 6)
                cxt++;
        } else
        if(keyCode == -1 && cxt > 0)
            cxt--;
        repaint();
    }

    private Image bg;
    private String about[] = {
        "Qur'an Digital", "Hak milik:", "bandungsoft.net", "@2009", "", "Gunakan Kartu Axis", "Untuk Membuka", "Aplikasi Islami"
    };
    private int ix;
    private int cxt;
    private static Font fontsmall = Font.getFont(64, 0, 8);
    private static Font fontBold = Font.getFont(64, 1, 8);
    private Quran midlet;

}
